package edu.gatech.volt2.drdoommgt.domain;

import java.util.*;
/**
 * This class represents an invoice to be billed to a patient.
 *
 * @author Paul Dewey
 */
public class Invoice
{
	private Patient patient;
	private BillingInfo billing;
	private Calendar date;
	private Doctor doc;
	
	/**
	 * Default constructor
	 */
	public Invoice()
	{
		this.patient = new Patient();
		this.billing = new BillingInfo();
		this.date = null;
		this.doc = new Doctor();
	}

	/**
	 * A constructor that takes in a patient and billing info.
	 *
	 * @param patient The patient.
	 * @param billing The billing info to be used.
	 * @param date Date of visit
	 * @param doc Treating doctor
	 */
	public Invoice(Patient patient, BillingInfo billing, Calendar date, Doctor doc)
	{
		this.patient = patient;
		this.billing = billing;
		this.date = date;
		this.doc = doc;
	}

	/**
	 * Concatenates a string of the file info
	 * @return result String of file info
	 */
	public String toString()
	{
		String result = "Patient: " + patient.getName() + "\nDate: " + date + 
		"\nDoctor: " + doc;
//		if(!billing.getTr().getDocOrders().getLabwork().isEmpty())
//			{
//				result+="\nLabwork:";
//				for(Labwork lw: billing.getTr().getDocOrders().getLabwork())
//				{
//					if(!lw.getBlood().equals("N/A"))
//					{
//						result+="\n " + lw.getBlood() + ", " + lw.getPrice();
//					}
//					
//					if(!lw.getUrine().equals("N/A"))
//					{
//						result+="\n " + lw.getUrine() + ", " + lw.getPrice();
//					}
//					
//					if(!lw.getImmunization().equals("N/A"))
//					{
//						result+="\n " + lw.getImmunization() + ", " + lw.getPrice();
//					}
//				}
//			}
		return result;
	}
	
	/**
	 * Sets the patient.
	 *
	 * @param patient The new patient.
	 */
	public void setPatient(Patient patient)
	{
		this.patient = patient;
	}

	/**
	 * Gets the patient.
	 *
	 * @return The patient.
	 */
	public Patient getPatient()
	{
		return patient;
	}

	/**
	 * Sets the billing info.
	 *
	 * @param billing The new billing info.
	 */
	public void setBilling(BillingInfo billing)
	{
		this.billing = billing;
	}

	/**
	 * Gets the billing info.
	 *
	 * @return The billing info.
	 */
	public BillingInfo getBilling()
	{
		return billing;
	}
	
	/**
	 * Date setter
	 * @param date Date of visit
	 */
	public void setDate(Calendar date)
	{
		this.date = date;
	}
	
	/**
	 * Date getter
	 * @return date Date of visit
	 */
	public Calendar getDate()
	{
		return date;
	}
	
	/**
	 * Doc setter
	 * @param doc Treating doctor
	 */
	public void setDoc(Doctor doc)
	{
		this.doc=doc;
	}
	
	/**
	 * Doc getter
	 * @return doc Treating doctor
	 */
	public Doctor getDoc()
	{
		return doc;
	}
}

